package com.example.idlefish.GoodsInfo.ActivityContract

import android.content.Context
import android.content.Intent
import android.util.Log
import androidx.activity.result.contract.ActivityResultContract
import com.example.idlefish.GoodsInfo.pojo.GoodEase
import com.example.idlefish.Message.MessageChatActivity
import com.example.idlefish.Message.MessagePreviewData

class ToChatContract: ActivityResultContract<Pair<GoodEase, MessagePreviewData>, Unit>() {
    override fun createIntent(context: Context, input: Pair<GoodEase, MessagePreviewData>): Intent {
        Log.i("传入聊天室的商品信息{}", input.first.toString())
        val intent = Intent(context, MessageChatActivity::class.java)

        intent.putExtra("goodInfo", input.first)
        intent.putExtra("messageInfo", input.second)
        return intent
    }

    override fun parseResult(resultCode: Int, intent: Intent?) {
        // Handle the result if needed
    }
}